<<<<<<< HEAD
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <div id="test">
        行数<input type="text" v-model=lineNum></input>
        列数<input type="text" v-model=colNum></input>
    </div>
    <button v-on:click="change">获取</button> {{sth}}

    <script src="node_modules/jquery/dist/jquery.js"></script>
    <script src="node_modules/vue/dist/vue.js"></script>
    <script>
        var vm = new Vue({
            el: "#test",
            data: {
                lineNum: "",
                colNum: "",
                sth: ""

            },
            methods: {
                change: function() {
                    var sth = "<table border='1'>";
                    for (var i = 0; i < colNum; i++) {
                        this.sth += "<tr>";
                        for (var j = 1; j <= lineNum; j++) {
                            this.sth += "<td>" + i * j + "</td>";
                        }
                        this.sth += "</tr>";
                    }
                    this.sth = sth + "</table>";
                }
            }
        })
    </script>
</body>

=======
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        table {
            border-collapse: collapse;
        }
    </style>

</head>

<body>

    <div id="app">
        <input type="text" class="col">行
        <input type="text" class="row">列
        <button v-on:click="create">生成</button><br>
        <table border=1px>
            <tr v-for="col in cols">
                <td v-for="row in rows">{{row}}</td>
            </tr>
        </table>
    </div>
    <script src="node_modules/vue/dist/vue.js"></script>
    <script src="node_modules/jquery/dist/jquery.js"></script>
    <script>
        var vm = new Vue({
            el: "#app",
            data: {
                cols: [],
                rows: []
            },
            methods: {
                create: function() {
                    var col = $(".col").val();
                    var row = $(".row").val();
                    this.cols = [];
                    this.rows = [];
                    for (var i = 0; i < col; i++) {
                        this.cols.push(i);
                    }
                    for (var i = 0; i < row; i++) {
                        this.rows.push(i)
                    }

                }
            }
        })
    </script>
</body>

>>>>>>> 4c11e06fa407523d32ab0b435b4508ac8f4e9953
</html>